package com.shop.listener;

import javax.servlet.ServletRequest;
import javax.servlet.ServletRequestEvent;
import javax.servlet.ServletRequestListener;
import javax.servlet.annotation.WebListener;

public class MyRequestListener  implements ServletRequestListener{

	public MyRequestListener(){
		System.out.println("====构造器创建对象====");
	}
	@Override
	public void requestInitialized(ServletRequestEvent sre) {
		ServletRequest servletRequest = sre.getServletRequest();
		System.out.println("初始化request对象===" +servletRequest);
	}
	
	@Override
	public void requestDestroyed(ServletRequestEvent sre) {
		String path = sre.getServletContext().getContextPath();
		System.out.println("销毁request对象==" + path);
	}
}
